home *** CD-ROM | disk | FTP | other *** search
/ My Neighborhood / My Neighborhood.iso / mac / MacFiles / Zoo6.Dxr / 00030.ls < prev    next >
Encoding:
Text File  |  1997-11-18  |  2.3 KB  |  81 lines

  1. on mouseDown
  2.   global activeSprite, homeV, homeH, snap1, snap2, RcurrentWeight, LcurrentWeight, stickH1List, stickH2List, stickV1List, stickV2List, homeHList, homeVList, stickh1, stickh2, stickv1, stickv2, offRight, offLeft, tempcount, oldActive
  3.   set activeSprite to the clickOn
  4.   set offLeft to 0
  5.   set offRight to 0
  6.   set snap1 to 0
  7.   set snap2 to 0
  8.   set tempR to RcurrentWeight - LcurrentWeight + 5
  9.   if tempR > 9 then
  10.     set tempR to 9
  11.   end if
  12.   if tempR < 1 then
  13.     set tempR to 1
  14.   end if
  15.   set good to 0
  16.   set G to 3
  17.   repeat while not good
  18.     set stickh1 to getAt(stickH1List, G)
  19.     set used to 0
  20.     repeat with f = 14 to 17
  21.       if the locH of sprite f = stickh1 then
  22.         set used to 1
  23.       end if
  24.     end repeat
  25.     set G to G + 1
  26.     if not used then
  27.       set good to 1
  28.     end if
  29.   end repeat
  30.   set good to 0
  31.   set G to 3
  32.   repeat while not good
  33.     set stickh2 to getAt(stickH2List, G)
  34.     set used to 0
  35.     repeat with f = 14 to 17
  36.       if the locH of sprite f = stickh2 then
  37.         set used to 1
  38.       end if
  39.     end repeat
  40.     set G to G + 1
  41.     if not used then
  42.       set good to 1
  43.     end if
  44.   end repeat
  45.   set stickv1 to getAt(stickV1List, tempR)
  46.   set stickv2 to getAt(stickV2List, tempR)
  47.   set homeH to getAt(homeHList, activeSprite - 13)
  48.   set homeV to getAt(homeVList, activeSprite - 13)
  49.   puppetSprite(30, 1)
  50.   if the castNum of sprite activeSprite < 231 then
  51.     set the castNum of sprite 30 to the castNum of sprite activeSprite + 10
  52.   else
  53.     set the castNum of sprite 30 to the castNum of sprite activeSprite
  54.   end if
  55.   set the visible of sprite 30 to 1
  56.   set the locH of sprite 30 to the locH of sprite activeSprite
  57.   set the locV of sprite 30 to the locV of sprite activeSprite
  58.   set oldActive to activeSprite
  59.   set the visible of sprite activeSprite to 0
  60.   set activeSprite to 30
  61.   if the locV of sprite activeSprite <> homeV then
  62.     if the locH of sprite activeSprite > 170 then
  63.       set offRight to 1
  64.       set stickv2 to the locV of sprite activeSprite
  65.       set stickh2 to the locH of sprite activeSprite
  66.     else
  67.       set offLeft to 1
  68.       set stickv1 to the locV of sprite activeSprite
  69.       set stickh1 to the locH of sprite activeSprite
  70.     end if
  71.   end if
  72.   go("num")
  73. end
  74.  
  75. on mouseUp
  76.   global activeSprite, oldActive
  77.   set the visible of sprite oldActive to 1
  78.   set the visible of sprite activeSprite to 0
  79.   go("S")
  80. end
  81.